package bigdata.mapreduce.relation;

import java.io.IOException;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

public class Map extends Mapper<Object,Text,Text,Text>{
	private Text key=new Text();
	private Text value=new Text();
	
	@Override
	public void map(Object key,Text value,Context context) throws IOException, InterruptedException {
		String[] strings=value.toString().split(",");
		
		this.key.set(strings[0]);
		this.value.set(strings[1]+",R");
		
		context.write(this.key, this.value);
		
		this.key.set(strings[1]);
		this.value.set(strings[0]+",S");
		
		context.write(this.key, this.value);
	}
}
